Definition:
- The Test Method is interacting with the SUT indirectly via another object thereby making the interactions more complex.
Code Example:
private final int LEGAL_CONN_MINS_SAME = 30;
public void testAnalyze_sameAirline_LessThanConnectionLimit()
throws Exception {
// setup
FlightConnection illegalConn = createSameAirlineConn( LEGAL_CONN_MINS_SAME - 1);
// exercise
FlightConnectionAnalyzerImpl sut = new FlightConnectionAnalyzerImpl();
String actualHtml = sut.getFlightConnectionAsHtmlFragment( illegalConn.getInboundFlightNumber(),
illegalConn.getOutboundFlightNumber());
// verification
StringBuffer expected = new StringBuffer();
expected.append("<span class=”boldRedText”>");
expected.append("Connection time between flight ");
expected.append(illegalConn.getInboundFlightNumber());
expected.append(" and flight ");
expected.append(illegalConn.getOutboundFlightNumber());
expected.append(" is ");
expected.append(illegalConn.getActualConnectionTime());
expected.append(" minutes.</span>");
assertEquals("html", expected.toString(), actualHtml);
}
References:
Quality attributes
- :octicon:`file-code;1em` - Code Example
- :octicon:`comment-discussion;1em` - Cause and Effect
- :octicon:`graph;1em` - Frequency
- :octicon:`sync;1em` - Refactoring
- A survey on test practitioners' awareness of test smells
- An Empirical Study into the Relationship Between Class Features and Test Smells :octicon:`graph;1em`
- An empirical analysis of the distribution of unit test smells and their impact on software maintenance :octicon:`graph;1em`
- An exploratory study of the relationship between software test smells and fault-proneness :octicon:`comment-discussion;1em` :octicon:`graph;1em`
- Are test smells really harmful? An empirical study :octicon:`comment-discussion;1em` :octicon:`graph;1em` :octicon:`sync;1em`
- Automatic generation of smell-free unit tests :octicon:`file-code;1em` :octicon:`comment-discussion;1em`
- Categorising Test Smells :octicon:`graph;1em`
- Detecting redundant unit tests for AspectJ programs
- Enhancing developers’ awareness on test suites’ quality with test smell summaries
- How are test smells treated in the wild? A tale of two empirical studies :octicon:`graph;1em`
- Obscure Test :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em`
- On the Relation of Test Smells to Software Code Quality
- On the diffusion of test smells in automatically generated test code: an empirical study
- On the interplay between software testing and evolution and its effect on program comprehension :octicon:`comment-discussion;1em`
- Refactoring Test Code :octicon:`comment-discussion;1em` :octicon:`sync;1em`
- Revisiting Test Smells in Automatically Generated Tests: Limitations, Pitfalls, and Opportunities :octicon:`graph;1em`
- Scented since the beginning: On the diffuseness of test smells in automatically generated test code
- Test Smell Detection Tools: A Systematic Mapping Study
- TestQ: Exploring Structural and Maintenance Characteristics of Unit Test Suites
- The Relation of Test-Related Factors to Software Quality: A Case Study on Apache Systems :octicon:`graph;1em`
- Why do builds fail?—A conceptual replication study